
package sg.edu.nus.iss.cats.model;

import java.util.*;

/**
 * Course class
 *
 * @version $Revision: 1.0
 */

public class Course implements java.io.Serializable {

    public static final String SUBMITTED = "SUBMITTED";
    public static final String APPROVED  = "APPROVED";
    public static final String WITHDRAWN = "WITHDRAWN";
    public static final String UPDATED   = "UPDATED";
    public static final String REJECTED  = "REJECTED";

    /** Attributes for Course **/
    private int courseId;
    private String  employeeId;
    private String  courseName;
    private String  organiser;
    private Date    fromDate;
    private Date    toDate;
    private float   fees;
    private boolean gstIncluded;
    private String  justification;
    private String  status;

    /** Container for CourseApplicationActions **/
    private List events = new ArrayList();

    public Course () {
    }
  

    public Course (int courseId) {
        this.setCourseId (courseId);
    }

    public void setCourseId (int courseId) {
        this.courseId = courseId;
    }

    public int getCourseId () {
        return courseId;
    }

    public void setEmployeeId (String employeeId) {
        this.employeeId = employeeId;
    }

    public String getEmployeeId () {
        return employeeId;
    }

    public void setCourseName (String courseName) {
        this.courseName = courseName;
    }

    public String getCourseName () {
        return courseName;
    }

    public void setOrganiser (String organiser) {
        this.organiser = organiser;
    }

    public String getOrganiser() {
        return organiser;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    public Date getFromDate() {
        return fromDate;
    }

    public void setToDate (Date toDate) {
        this.toDate = toDate;
    }

    public Date getToDate() {
        return toDate;
    }

    public void setFees (float fees) {
        this.fees = fees;
    }

    public float getFees () {
        return fees;
    }

    public void setGstIncluded (boolean gstIncluded) {
        this.gstIncluded = gstIncluded;
    }

    public boolean getGstIncluded() {
        return gstIncluded;
    }

    public void setJustification(String justification) {
        this.justification = justification;
    }

    public String getJustification () {
        return justification;
    }

    public void setStatus (String status) {
        this.status = status;
    }

    public String getStatus () {
        return status;
    }

     /** Methods for handling the CourseEvents **/
    public void setCourseEvents (CourseEvent[] newEvents) {
        //clearCourseEvents ();
        for (int i = 0; i < newEvents.length; i++) {
            addCourseEvents (newEvents[i]);
        }
    }

    public CourseEvent[] getCourseEvents () {
        int count = events.size();
        CourseEvent[] result = new CourseEvent[count];
        result = (CourseEvent[]) events.toArray (result);
        return result;
    }

    public void clearCourseEvents () {
        events = new ArrayList();
    }

    public void addCourseEvents (CourseEvent newEvent) {
        events.add (newEvent);
    }


	public ArrayList getEvents() {
		return new ArrayList(events);
	}


	public void setEvents(List events) {
		this.events = new ArrayList(events);
	}
}